package server

import (
	"wolongauth/config"
	"wolongauth/errhelp"
	"wolongauth/global"

	"github.com/gofiber/fiber/v2"
)

func StartSendToHttpsServer() {
	global.Logger.Info("正在启动send to server...")
	sendserver := fiber.New(fiber.Config{
		ErrorHandler: func(c *fiber.Ctx, err error) error {
			return c.Redirect("https://" + c.Hostname() + c.Path())
		},
	})
	err := sendserver.Listen(":" + config.GetConfig().SendPort)
	errhelp.ErrDoWithTagAndAbort(err, "Send Server")
}
